﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Role Management</title>
    <script src="/lib/jquery.event.drag-2.0.min.js"></script>
    <script src="/plugins/slick.core.js"></script>
    <script src="/plugins/slick.checkboxselectcolumn.js"></script>
    <script src="/plugins/slick.autotooltips.js"></script>
    <script src="/plugins/slick.cellrangedecorator.js"></script>
    <script src="/plugins/slick.cellrangeselector.js"></script>
    <script src="/plugins/slick.cellcopymanager.js"></script>
    <script src="/plugins/slick.cellselectionmodel.js"></script>
    <script src="/plugins/slick.rowselectionmodel.js"></script>
    <script src="/plugins/slick.formatters.js"></script>
    <script src="/plugins/slick.editors.js"></script>
    <script src="/plugins/slick.grid.js"></script>
    <script src="/Scripts/Helper.js" type="text/javascript"></script>
    <script type="text/javascript">
        var helper = new Helper();
        var grid;
        var data = [];
        var columns = [
    { id: "UserName", name: "UserName", field: "UserName", width: 120, cssClass: "cell-title" },
    { id: "DomainName", name: "DomainName", field: "DomainName" },
    { id: "FirstName", name: "FirstName", field: "FirstName", width: 80, resizable: false },
    { id: "Lastname", name: "Lastname", field: "Lastname", minWidth: 60 },
    { id: "Email", name: "Email", field: "Email", minWidth: 60 },
    { id: "RoleID", name: "RoleID", field: "RoleID", sortable: false, width: 80, minWidth: 20, maxWidth: 80, cssClass: "cell-effort-driven" }
  ];
        var checkboxSelector = new Slick.CheckboxSelectColumn({
            cssClass: "slick-cell-checkboxsel"
        });
        columns.splice(0, 0, checkboxSelector.getColumnDefinition());

        var options = {
            editable: true,
            enableRowReordering: true,
            enableCellNavigation: true,
            asyncEditorLoading: false,
            autoEdit: false


        };
        function RefreshUser(parameters) {
            helper.GetUserDb(function (userdb) {
                grid = new Slick.Grid("#myGrid", userdb, columns, options);
                grid.setSelectionModel(new Slick.RowSelectionModel({ selectActiveRow: true }));
                grid.registerPlugin(checkboxSelector);
            });
        }
        $(function () {
            RefreshUser();

            //            for (var i = 0; i < 500; i++) {
            //                var d = (data[i] = {});

            //                d["title"] = "Task " + i;
            //                d["duration"] = "5 days";
            //                d["percentComplete"] = Math.min(100, Math.round(Math.random() * 110));
            //                d["start"] = "01/01/2009";
            //                d["finish"] = "01/05/2009";
            //                d["effortDriven"] = (i % 5 == 0);
            //            }

            //            grid = new Slick.Grid("#myGrid", data, columns, options);
        })
            
       
    </script>
</head>
<body>
    <div id="RoleGrid" style="width: 100%; height: 300px;">
    </div>
    <div id="dialog-form" class="ui-dialog-content ui-widget-content" style="width: auto;
        min-height: 0px; height: 208.4px;" scrolltop="0" scrollleft="0">
        <p class="validateTips">
            All form fields are required.</p>
        <form>
        <fieldset>
            <div style="clear: both">
            </div>
            <label for="name">
                Name</label>
            <br />
            <input type="text" class="text ui-widget-content ui-corner-all" id="name" name="name">
            <br />
            <label for="email">
                Email</label>
            <br />
            <input type="text" class="text ui-widget-content ui-corner-all" value="" id="email"
                name="email">
            <br />
            <label for="password">
                Password</label>
            <br />
            <input type="password" class="text ui-widget-content ui-corner-all" value="" id="password"
                name="password">
        </fieldset>
        </form>
    </div>
</body>
</html>
